package gov.pbc.nn.kjgl.train.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.bstek.bdf2.core.context.ContextHolder;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.data.provider.Page;

import gov.pbc.nn.core.dao.AbstractHibernateDao;
import gov.pbc.nn.kjgl.entity.TrainingPlan;
import gov.pbc.nn.uflo.UfloUtils;
import gov.pbc.nn.uflo.entity.Opinion;
import gov.pbc.nn.uflo.view.PbcToDoTaskMaintain;

@Repository
public class QueryTrainPlanDao  extends AbstractHibernateDao{
	
	/**
	 * 查询所有培训计划
	 * 
	 * @param page
	 */
	public void getAll(Page<TrainingPlan> page) {
		DetachedCriteria query = DetachedCriteria.forClass(TrainingPlan.class);
		query.add(Restrictions.or(Restrictions.eq("invalid", false), Restrictions.isNull("invalid")));
		this.pagingQuery(page, query);
	}
	
	public List<Opinion> loadOpinion(String id) {
		List<Opinion>  opinion= UfloUtils.getOpinions(null, id, null, null,null);
		return opinion;
	}
}
